package com.kurumi.autoprint.pojo.print;

import java.math.BigDecimal;
import java.util.Date;

import org.apache.commons.lang3.StringUtils;

import com.kurumi.autoprint.enums.ResponseStatusEnum;
import com.kurumi.autoprint.util.Result;

public class PrintMrOrder {
	private Integer id;
	//收费渠道
	private String feeRouteCode;
	private String feeRouteName;
	//付款设备id
	private String sendAccount;
	//总费用
	private BigDecimal fee;
	//支付状态
	private Integer status;
	//订单创建时间
	private Date ORDER_CREATE_TIME;
	//通知时间
	private Date notifyTime;
	//订单号
	private String orderNum;
	//打印总页数
	private Integer printTotalPages;
	//打印单价
	private BigDecimal printUnitPrice;
	//身份证号
	private String idNumber;
	//打印状态
	private Integer printStatus;
	//客户端访问Ip
	private String ip;
	
	//打印错误信息
	private String  printErrorMsg;
	
	//联系电话
	private String phone;
	
	
	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	public String getFeeRouteCode() {
		return feeRouteCode;
	}
	public void setFeeRouteCode(String feeRouteCode) {
		this.feeRouteCode = feeRouteCode;
	}
	public String getFeeRouteName() {
		return feeRouteName;
	}
	public void setFeeRouteName(String feeRouteName) {
		this.feeRouteName = feeRouteName;
	}
	public String getSendAccount() {
		return sendAccount;
	}
	public void setSendAccount(String sendAccount) {
		this.sendAccount = sendAccount;
	}
	public BigDecimal getFee() {
		return fee;
	}
	public void setFee(BigDecimal fee) {
		this.fee = fee;
	}
	public Integer getStatus() {
		return status;
	}
	public void setStatus(Integer status) {
		this.status = status;
	}
	public Date getORDER_CREATE_TIME() {
		return ORDER_CREATE_TIME;
	}
	public void setORDER_CREATE_TIME(Date oRDER_CREATE_TIME) {
		ORDER_CREATE_TIME = oRDER_CREATE_TIME;
	}
	public Date getNotifyTime() {
		return notifyTime;
	}
	public void setNotifyTime(Date notifyTime) {
		this.notifyTime = notifyTime;
	}
	public String getOrderNum() {
		return orderNum;
	}
	public void setOrderNum(String orderNum) {
		this.orderNum = orderNum;
	}
	public Integer getPrintTotalPages() {
		return printTotalPages;
	}
	public void setPrintTotalPages(Integer printTotalPages) {
		this.printTotalPages = printTotalPages;
	}
	public BigDecimal getPrintUnitPrice() {
		return printUnitPrice;
	}
	public void setPrintUnitPrice(BigDecimal printUnitPrice) {
		this.printUnitPrice = printUnitPrice;
	}
	public String getIdNumber() {
		return idNumber;
	}
	public void setIdNumber(String idNumber) {
		this.idNumber = idNumber;
	}
	public Integer getPrintStatus() {
		return printStatus;
	}
	public void setPrintStatus(Integer printStatus) {
		this.printStatus = printStatus;
	}
	public String getIp() {
		return ip;
	}
	public void setIp(String ip) {
		this.ip = ip;
	}
	
	
	
	
	
	public String getPrintErrorMsg() {
		return printErrorMsg;
	}
	public void setPrintErrorMsg(String printErrorMsg) {
		this.printErrorMsg = printErrorMsg;
	}
	public String getPhone() {
		return phone;
	}
	public void setPhone(String phone) {
		this.phone = phone;
	}
	public Result fieldVerify(PrintMrOrder printMrOrder) {
		if (printMrOrder.getFee() == null) {
			return new Result(false, "打印费用不能为空!", null, ResponseStatusEnum.PARAM_VERIFY.getValue());
		}
		
		if (printMrOrder.getFee().compareTo(new BigDecimal("0")) == -1) {
			return new Result(false, "打印费用不能小于0!", null, ResponseStatusEnum.PARAM_VERIFY.getValue());
		}
		
		if (printMrOrder.getPrintTotalPages() == null) {
			return new Result(false, "打印总页数不能为空!", null, ResponseStatusEnum.PARAM_VERIFY.getValue());
		}
		
		if (printMrOrder.getPrintTotalPages().intValue() <= 0) {
			return new Result(false, "打印总页数不能小于等于0页!", null, ResponseStatusEnum.PARAM_VERIFY.getValue()); 
		}
		
		if (StringUtils.isBlank(printMrOrder.getIdNumber())) {
			return new Result(false, "身份证号不能为空!");
		}
		
		return new Result(true, "验证成功", null, 200);
	}
	
	@Override
	public String toString() {
		return "PrintMrOrder [id=" + id + ", feeRouteCode=" + feeRouteCode + ", feeRouteName=" + feeRouteName
				+ ", sendAccount=" + sendAccount + ", fee=" + fee + ", status=" + status + ", ORDER_CREATE_TIME="
				+ ORDER_CREATE_TIME + ", notifyTime=" + notifyTime + ", orderNum=" + orderNum + ", printTotalPages="
				+ printTotalPages + ", printUnitPrice=" + printUnitPrice + ", idNumber=" + idNumber + ", printStatus="
				+ printStatus + "]";
	}
	
	
	
	
	

}
